home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / RGASM.RAR / ASMCODE.EXE / CHAPT12 / CCOL.ASM < prev    next >
Encoding:
Assembly Source File  |  1994-08-27  |  1.3 KB  |  51 lines

  1. ;************************************************************
  2. ;  Program CCol ( Chapter 12 )
  3. ;
  4. ;  The PC screen input/output library    Version 1.0
  5. ;  Subroutine for clearing the display screen
  6. ;      (filling it with a specified color)
  7. ;  Copyright (c): A.I.Sopin, Voronezh, Russia 1990 - 1991
  8. ;
  9. ;  This subroutine can be called from programs written in C/C++
  10. ;
  11. ;  Usage: CCOLOR( M, N, C)
  12. ;
  13. ;  Parameters:
  14. ;
  15. ;  M  - first line to be cleared
  16. ;  N  - last line to be cleared
  17. ;  C  - background and character attributes
  18. ;
  19. ;  All parameters are  through the stack
  20. ;
  21. ;***********************************************************
  22.     DOSSEG
  23.     .MODEL  SMALL
  24. EXTRN   COLOR : FAR
  25.     .CODE
  26.     PUBLIC  _CCOLOR
  27. _CCOLOR  PROC    NEAR
  28.     push    bp
  29.     mov     bp,sp
  30.     push    ax
  31.     push    bx
  32.     push    cx
  33.     push    dx
  34.  
  35. ;----------------------------------------------------------
  36. ;  Accrpt parameters passed
  37.     mov     CH,[bp+4]                  ; number of first line M
  38.     mov     DH,[bp+6]                  ; number of last line N
  39.     mov     AH,[bp+8]                  ; video attribute  C
  40.     call    far ptr COLOR              ; function subroutine call
  41. ;  Restore registers and exit
  42.     pop     dx
  43.     pop     cx
  44.     pop     bx
  45.     pop     ax
  46.     mov     sp,bp
  47.     pop     bp
  48.     RETN
  49. _CCOLOR  ENDP
  50.     END
  51.